package com.ruoyi.web.pojo.request.devicedata;

import cn.hutool.core.net.url.UrlBuilder;
import com.ruoyi.web.utils.BasePageQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;

/**
 * @desc  设备图片分页查询
 * @author fwx 2024/1/25 13:51
 **/
@Data
public class DevicePhotoRequest  extends BasePageQuery {

    @ApiModelProperty(value = "设备ID")
    @NotEmpty(message = "设备id不能为空")
    private String deviceId;

    @ApiModelProperty(value = "数据开始时间,格式 yyyy-MM-dd")
    private String startTime;

    @ApiModelProperty(value = "数据结束时间")
    private String endTime;

    @ApiModelProperty(value = "是否过滤识别 1 有识别数据 2 无识别数据 不传全部") //，2月报表，3年报表
    private Integer recogFlag;

    @ApiModelProperty(value = "预置点名称")
    private String presetName;

    public UrlBuilder getQuery(){
        UrlBuilder builder = UrlBuilder.of();
        if (this.getDeviceId() != null)builder.addQuery("deviceId",this.getDeviceId());
        if (this.getRecogFlag() != null) builder.addQuery("recogFlag",this.getRecogFlag());
        builder.addQuery("pageSize",this.getPageSize());
        builder.addQuery("pageNum",this.getPageNum());
        if (this.getStartTime() != null) builder.addQuery("startTime",this.getStartTime());
        if (this.getEndTime() != null) builder.addQuery("endTime",this.getEndTime());

        return builder;
    }
}
